<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlertCameraStatusToShopArchives extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('shop_archives', function (Blueprint $table) {
            $table->unsignedTinyInteger('cameraStatus')->default(0)->comment('摄像头状态 0-缺失 1-在线 2-离线 3-部分在线');
            $table->index('shopId', 'idx_shopId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('shop_archives', function (Blueprint $table) {
            $table->dropColumn('cameraStatus');
            $table->dropIndex('idx_shopId');
        });
    }
}
